<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Mail;

class SendEmail implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
    protected $data;

    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($data)
    {
        $this->data=$data;


    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
//       Mail::raw('床前明月光',function ($message){
//           $message->from('syj198920@163.com','今晚打老虎');
//           $message->subject('床前明月光,明月是谁??');
//           $message->to($this->email);
//       });
        echo json_encode($this->data);
//        Log::error('邮件已经发送啦',['abc'=>1231]);
    }
}
